//
//  GKZYSortViewController.m
//  GKZYAid
//
//  Created by lanou3g on 16/2/27.
//  Copyright © 2016年 GKZYAid. All rights reserved.
//

#import "GKZYSortViewController.h"
#import "GKZYSortView.h"
#import "GKZYBatchQueryViewController.h"
#import "GKZYUniversityQueryViewController.h"
#import "GKZYMajorQueryViewController.h"
#import "GKZYRankingListViewController.h"
#import "GKZYScoreQueryViewController.h"
#import "GKZYUserSortDataHandel.h"
#import "MyDefine.h"
#import "GKZYUserSortViewController.h"

@interface GKZYSortViewController ()
@property(nonatomic,strong)GKZYSortView *sortView;
@end

@implementation GKZYSortViewController

-(void)loadView{

    [super loadView];
    self.sortView = [[GKZYSortView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.view = self.sortView;
   
}


- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"查询";
    self.view.backgroundColor = [UIColor whiteColor];
    //第二级controllerView的跳转
//    [self pushToSecondaryVC];
  
}

-(void)viewWillAppear:(BOOL)animated{

    [super viewWillAppear:YES];
    [self pushToSecondaryVC];
   
}


-(void)pushToSecondaryVC{

    UITapGestureRecognizer *scoreItemTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(pushToScoreVC)];
    [self.sortView.scoreInquireItem addGestureRecognizer:scoreItemTap];
    
    UITapGestureRecognizer *batchItemTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(pushToBatchVC)];
    [self.sortView.passSoreItem addGestureRecognizer:batchItemTap];
    
    UITapGestureRecognizer *majorItemTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(pushToMajorVC)];
    [self.sortView.projectItem addGestureRecognizer:majorItemTap];
    
    UITapGestureRecognizer *schollItemTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(pushToSchoolVC)];
    [self.sortView.schoolItem addGestureRecognizer:schollItemTap];
    
    UITapGestureRecognizer *hotItemTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(pushToRankingVC)];
    [self.sortView.hotSortItem addGestureRecognizer:hotItemTap];

}
//跳转到分数查询VC
-(void)pushToScoreVC{

    GKZYScoreQueryViewController *scoreVC = [[GKZYScoreQueryViewController alloc]init];
  
    [self.navigationController pushViewController:scoreVC animated:YES];
}

//跳转到批次查询VC
-(void)pushToBatchVC{
    
    GKZYBatchQueryViewController *batchVC = [[GKZYBatchQueryViewController alloc]init];
    [self.navigationController pushViewController:batchVC animated:YES];
}


//跳转到专业查询VC
-(void)pushToMajorVC{
    
    if (SINGLETON.loc_name == nil || SINGLETON.score == nil || SINGLETON.wl ==nil  || [SINGLETON.score isEqualToString:@""]) {
        GKZYUserSortViewController *sortVC = [[GKZYUserSortViewController alloc]init];
        [self.navigationController pushViewController:sortVC animated:YES];
    }else{
    GKZYMajorQueryViewController *majorVC = [[GKZYMajorQueryViewController alloc]init];
        [self.navigationController pushViewController:majorVC animated:YES];
    }
}

//跳转到学校查询VC
-(void)pushToSchoolVC{
    
    if (SINGLETON.loc_name == nil || SINGLETON.score == nil || SINGLETON.wl ==nil || [SINGLETON.score isEqualToString:@""]) {
        GKZYUserSortViewController *sortVC = [[GKZYUserSortViewController alloc]init];
        [self.navigationController pushViewController:sortVC animated:YES];
    }else{
        GKZYUniversityQueryViewController *schoolVC = [[GKZYUniversityQueryViewController alloc]init];
        [self.navigationController pushViewController:schoolVC animated:YES];
    }
}

//跳转到排行查询VC
-(void)pushToRankingVC{
    
    GKZYRankingListViewController *rankingVC = [[GKZYRankingListViewController alloc]init];
    [self.navigationController pushViewController:rankingVC animated:YES];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
